package com.jj.widget;

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.jj.R;
import com.jj.base.BaseApplication;

/**
 * Created by qmsoft05 on 2017/3/17.
 */

public class WaitDialog extends Dialog {

    public WaitDialog(@NonNull Context context) {
        super(context, R.style.dialog_windowbackground_translucent);
    }

    public WaitDialog(@NonNull Context context, @StyleRes int themeResId) {
        super(context, themeResId);
    }

    protected WaitDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_waitdialog);
        setCancelable(false);
        ImageView iv_waitdialog = (ImageView) findViewById(R.id.iv_waitdialog);
        Glide.with(iv_waitdialog.getContext()).load(R.drawable.gif_waitdialog).asGif().diskCacheStrategy(DiskCacheStrategy.RESULT).skipMemoryCache(true).into(iv_waitdialog);
    }

    @Override
    public void show() {
        super.show();
    }

    @Override
    public void dismiss() {
        super.dismiss();
    }
}
